#include <cmath>  /* for std::abs(double) */

inline bool isEqual(double x, double y)
{
	const double epsilon = 1e-13;
	return std::abs(x - y) <= epsilon * std::abs(x);
	// see Knuth section 4.2.2 pages 217-218
} 